<%--
  Created by IntelliJ IDEA.
  User: yzl
  Date: 2018/7/12
  Time: 8:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!--此处只放公共部分-->
<%--在其他需要的地方导入--%>
<div class="menu">
    <ul>
        <li style="width:0px;"><a></a></li>
        <li><a href="/index" class="home">首页</a></li>
        <li><a href="/cart" class="cart">购物车</a></li>
        <li><a href="/order" class="checkout">订单</a></li>




        <c:if test="${sessionScope.member == null}">
            <li style="float:right;"><a href="/login" class="login">登录</a></li>
            <li style="float:right;"><a href="/login" class="register">注册</a></li>
        </c:if>

        <c:if test="${sessionScope.member != null}">
            <li style="float:right;"><a href="/logout" class="logout">退出登录</a></li>

            <li style="float:right;"><a href="" class="register">${member.name}</a></li>
        </c:if>

    </ul>
</div>

<div style="width:1000px;margin:0 auto;">
    <div id="cart">
        <div class="heading">
            <a style="padding:8px;margin-left:-14px;">购物车</a><span
                style="font-size:14px;color:#fff;">&raquo;</span>
            <a>
                <c:if test="${requestScope.cartDetail != null}">
                    <span id="cart_total">${requestScope.cartDetail.totalCount} 件 - ￥${requestScope.cartDetail.totalPrice}</span>
                </c:if>
                <c:if test="${requestScope.cartDetail == null}">
                    <span id="cart_total">0 件 - ￥0.00</span>
                </c:if>


            </a></div>
        <div class="content"></div>
    </div>
    <div id="search">
        <form action="/list">
            <input type="submit" id="MySearchBoxButton" style="display: none;"/>
            <div class="button-search" onclick="document.getElementById('MySearchBoxButton').click();"></div>
            <input type="text" name="keyWord" value="${param.keyWord}" onkeydown="this.style.color = '#888';"/>
        </form>
    </div>

</div>

<div class="header">
    <div class="logo_img"><a href="index"><img alt="Site Name" src="/images/logo.png"></a></div>
</div>

<div id="menu">
    <ul>
        <c:forEach items="${requestScope.nav}" var="nav">
            <li><a href="/list?cid=${nav.cid}">${nav.name}</a>
                <div>
                    <ul>
                        <c:forEach items="${nav.brands}" var="brand">
                            <li><a href="/list?cid=${nav.cid}&bid=${brand.bid}">${brand.name}</a></li>
                        </c:forEach>
                    </ul>
                </div>
            </li>
        </c:forEach>
        <li><a href="/list">全部商品</a></li>
    </ul>
</div>


